home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
prog
/
mint
/
duftp
/
dispatch.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-06-17
|
3KB
|
99 lines
/*
DUFTP
*/
// Dialog Dispatcher (opens dialogs in response to object being clicked on)
#include <DULIB.H>
#include "globals.h"
#include "duftp_n.h"
short dispatcher(void)
{
switch(this_ob)
{
case About_ftp:
activate_dialog(About,"About DUftp",DIAL_ROLLUP);
break;
case Win_ftp:
activate_dialog(Mainwindow,"File Transfer",DIAL_ROLLUP);
break;
case Win_hosts:
activate_dialog(Hosts,"FTP Server Bookmarks List",DIAL_ROLLUP);
break;
case Mftp_open:
case Open_new_server:
sprintf(new_server_path,"/ ");
sprintf(new_server_address," ");
sprintf(new_server_login,"anonymous ");
sprintf(new_server_password,"me@ ");
set_dialog_text(Open_new, Open_new_path,new_server_path);
set_dialog_text(Open_new, Open_new_name,new_server_address);
set_dialog_text(Open_new, Open_new_login,new_server_login);
set_dialog_text(Open_new, Open_new_pass,new_server_password);
Set_dialog_Kfocus(Open_new, Open_new_name);
activate_dialog(Open_new,"Open FTP Server",DIAL_NO_CLOSE);
break;
}
return TRUE;
}
short destructor(void)
{
switch(this_ob)
{
case Open_new_open:
close_dialog(Open_new);
open_new_server();
break;
case Open_new_cancel:
close_dialog(Open_new);
break;
}
return TRUE;
}
short Kdispatcher(void)
{
switch(kc_key)
{
case 0x3000:
activate_dialog(Hosts,"FTP Server Bookmarks List",DIAL_ROLLUP);
break;
case 0x2100:
activate_dialog(Mainwindow,"File Transfer",DIAL_ROLLUP);
break;
case 0x1800:
sprintf(new_server_path,"/ ");
sprintf(new_server_address," ");
sprintf(new_server_login,"anonymous ");
sprintf(new_server_password,"me ");
set_dialog_text(Open_new, Open_new_name,new_server_address);
set_dialog_text(Open_new, Open_new_login,new_server_login);
set_dialog_text(Open_new, Open_new_pass,new_server_password);
set_dialog_text(Open_new, Open_new_path,new_server_path);
Set_dialog_Kfocus(Open_new, Open_new_name);
activate_dialog(Open_new,"Open FTP Server",DIAL_NO_CLOSE);
break;
}
return TRUE;
}
short Kdestructor(void)
{
switch(this_dialog)
{
case Open_new:
switch(kc_key)
{
case 0x1c0d:
close_dialog(Open_new);
open_new_server();
return TRUE;
break;
}
break;
}
return FALSE;
}